<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>个人社保计算-网页版</title>
		<!-- 新 Bootstrap 核心 CSS 文件 -->
<link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
 
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
 
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script>
	function calc(){
		sal=document.getElementById("salary").value;
		salnum=parseInt(sal);
		ylgr01=salnum*0.08;
		ylgs01=salnum*0.2;
		document.getElementById("养老个人").innerText=ylgr01;
		document.getElementById("养老公司").innerText=ylgs01;
		ybgr01=salnum*0.02;
		ybgs01=salnum*0.06;
		document.getElementById("医保个人").innerText=ybgr01;
		document.getElementById("医保公司").innerText=ybgs01;
		sygr01=salnum*0.005;
		sygs01=salnum*0.015;
		document.getElementById("失业个人").innerText=sygr01;
		document.getElementById("失业公司").innerText=sygs01;
		gsgs01=salnum*0.005;
		document.getElementById("工伤公司").innerText=gsgs01;
		sygs02=salnum*0.008;
		document.getElementById("生育公司").innerText=sygs02;
		gjjgr01=salnum*0.12;
		gjjgs01=salnum*0.12;
		document.getElementById("公积金个人").innerText=gjjgr01;
		document.getElementById("公积金公司").innerText=gjjgs01;
		hjgr01=ylgr01+ybgr01+sygr01+gjjgr01;
		hjgs01=ylgs01+ybgs01+sygs01+gsgs01+sygs02+gjjgs01;
		document.getElementById("合计个人").innerText=hjgr01;
		document.getElementById("合计公司").innerText=hjgs01;
		hjze01=salnum+hjgs01;
		document.getElementById("total").innerText=hjze01;
	}
</script>
	</head>
	<body>
	<div class="container text-center">
		<h2>个人社保计算软件</h2>
		<table class="table table-bordered text-center">
			<tr>
				<td>工资</td>
				<td colspan="3"> 
					<input  class="form-control" placeholder="用户输入" id="salary" type="text"/>
				</td>
				<td>
					<button onclick="calc()" class="btn btn-danger btn-block">计算</button>
				</td>
			</tr>
			<tr class="bg-primary">
				<td>险种</td>
				<td>个人%</td>
				<td>个人</td>
				<td>公司%</td>
				<td>公司</td>
			</tr>
			<tr>
				<td class="bg-info">养老</td>
				<td>8%</td>
				<td id="养老个人"></td>
				<td>20%</td>
				<td id="养老公司"></td>
			</tr>
			<tr>
				<td class="bg-info">医保</td>
				<td>2%</td>
				<td id="医保个人"></td>
				<td>6%</td>
				<td id="医保公司"></td>
			</tr>
			<tr>
				<td class="bg-info">失业</td>
				<td>0.5%</td>
				<td id="失业个人"></td>
				<td>1.5%</td>
				<td id="失业公司"></td>
			</tr>
            <tr>
				<td class="bg-info">工伤</td>
				<td></td>
				<td></td>
				<td>0.5%</td>
				<td id="工伤公司"></td>
			</tr>
			<tr>
				<td class="bg-info">生育</td>
				<td></td>
				<td></td>
				<td>0.8%</td>
				<td id="生育公司"></td>
			</tr>
			<tr>
				<td class="bg-info">公积金</td>
				<td>12%</td>
				<td id="公积金个人"></td>
				<td>12%</td>
				<td id="公积金公司"></td>
			</tr>
			<tr>
				<td class="bg-info">合计</td>
				<td>个人合计</td>
				<td id="合计个人"></td>
				<td>公司合计</td>
				<td id="合计公司"></td>
			</tr>
			<tr>
				<td class="bg-info">总额</td>
				<td colspan="4" id="total"></td>
			</tr>
		</table>
		0107李媛
	</div>	
	</body>
</html>
